From: kaf24@firebug.cl.cam.ac.uk Date: Mon, 3 Jul 2006 08:06:59 +0000 (+0100) Subject: [NET] front: Zero negotiated bits in xen_set_features X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15906 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=7232160efd8658919cb987b8a72770b3bd5ea7b3;p=xen.git [NET] front: Zero negotiated bits in xen_set_features When we reconnect to the backend we need to first zero all negotiated bits as the functions xen_set_sg and xen_set_tso do not (and are not supposed to) zero bits when they fail to set them. This patch also permanently enables the NETIF_F_GSO_ROBUST bit as we never parse any GSO fields ourselves (even if we did the backend could not trust us so it's wasted effort). Signed-off-by: Herbert Xu --- diff --git a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c index 36c0ef266c..016f4d1220 100644 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c @@ -1112,6 +1112,11 @@ static int xennet_set_tso(struct net_device *dev, u32 data) static void xennet_set_features(struct net_device *dev) { + /* Turn off all GSO bits except ROBUST. */ + dev->features &= (1 << NETIF_F_GSO_SHIFT) - 1; + dev->features |= NETIF_F_GSO_ROBUST; + xennet_set_sg(dev, 0); + if (!xennet_set_sg(dev, 1)) xennet_set_tso(dev, 1); }